RCAD script
1.00
Do_x_y
doxyup.bmp
doxydown.bmp
3
0
1
1er clic = reference ? (yes/oui or no/non)
Font
Size







yes
Helvetica
10







Dim s_x, s_y, s_x1,s_y1,s_x2,s_y2 as double
Dim s_t as integer

if GlobalScript1 < 0 then
   if (userinput1 = "yes") or (userinput1 = "oui") then
      GlobalScript1 = Firstx
      GlobalScript2 = Firsty
   else
      GlobalScript1 = 0
      GlobalScript2 = 0
   end if
end if
s_t = val(userinput3)
Add_Line(Firstx, Firsty, Lastx, Lasty, 0.25, 7, False, True, False, 100)
s_x = Global_x(Firstx) - Global_x(GlobalScript1)
s_y = Global_y(Firsty) - Global_y(GlobalScript2)
if Lastx > Firstx then
   Add_String("x = " + Format(s_x,"-#.000"), Lastx + 3, Lasty - 2, s_t, 0, False, False, False, 7, 0, userinput2, False, False, 0, 100, 100)
   BoundRectLastObject
   s_x1 = BoundRectMinx
   s_y1 = BoundRectMiny
   s_x2 = BoundRectMaxx
   s_y2 = BoundRectMaxy
   Add_String("y = " + Format(s_y,"-#.000"), Lastx + 3, Lasty + 12, s_t, 0, False, False, False, 7, 0, userinput2, False, False, 0, 100, 100)
else
   Add_String("x = " + Format(s_x,"-#.000"), Lastx - 3, Lasty - 2, s_t, 2, False, False, False, 7, 0, userinput2, False, False, 0, 100, 100)
   BoundRectLastObject
   s_x1 = BoundRectMinx
   s_y1 = BoundRectMiny
   s_x2 = BoundRectMaxx
   s_y2 = BoundRectMaxy
   Add_String("y = " + Format(s_y,"-#.000"), Lastx - 3, Lasty + 12, s_t, 2, False, False, False, 7, 0, userinput2, False, False, 0, 100, 100)
end if
BoundRectLastObject
if BoundRectMinx < s_x1 then
   s_x1 = BoundRectMinx
end if
if BoundRectMiny < s_y1 then
   s_y1 = BoundRectMiny
end if
if BoundRectMaxx > s_x2 then
   s_x2 = BoundRectMaxx
end if
if BoundRectMaxy > s_y2 then
   s_y2 = BoundRectMaxy
end if
Add_Rect(s_x1 - 3, s_y1 - 3, s_x2 + 3, s_y2 + 3, 0.25, 7, 0, False, 100, 100)
